﻿<%@ Page Title="Veja os nossos cursos" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeBehind="Cursos.aspx.cs" Inherits="CursoUNICEUB.About" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
    <style type="text/css">
        h2
        {
            font-size: 1.7em;
        }
            
        .tabelaCursos
        {
            width: 70%;
            margin: 1.5em auto 1.7em auto;
        }
        
        #cursoValor
        {
            font-size: 1.1em;
            width: 90%;
            text-align: justify;
            text-indent: 2.4em;
        }
    </style>
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <h1>
        <u>Nossos cursos</u>
    </h1>
    <br />
    <center>
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"  GridLines="None" CssClass="tabelaCursos"
            DataSourceID="DBCursos" CellPadding="8" ForeColor="#333333" Width="95%">
            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
            <Columns>
              <asp:TemplateField HeaderText="Curso">
                    <ItemTemplate><%# Eval("DETipoCurso.Nome")%></ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Período">
                    <ItemTemplate>De <%# Eval("DataInicio", "{0:dd/MM}") %> até <%# Eval("DataFim", "{0:dd/MM}") %></ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Horário">
                    <ItemTemplate><%# Eval("DECursoHorario.Dias")%> das <%# Eval("DECursoHorario.HoraInicial")%> às <%# Eval("DECursoHorario.HoraFinal")%></ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Valor">
                    <ItemTemplate>R$ <%# Eval("DETipoCurso.Valor", "{0:#.##}")%>,00</ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Vagas">
                    <ItemTemplate> <asp:Label ID="lbVagas" runat="server" /> </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Status">
                    <ItemTemplate>
                        <asp:Label ID="lbStatus" runat="server" /><br />
                        <asp:LinkButton ID="lnkMatricula" Text="Matricule-se!" runat="server" Visible="false" />
                        <%# PreencherTabela((GridViewRow)Container) %>
                    </ItemTemplate>
                </asp:TemplateField>
              <asp:TemplateField>
                    <ItemTemplate>
                    <asp:ImageButton ToolTip="Veja aqui o calendário do curso" ID="imgBtnCalendario" runat="server" OnClick="Calendario_Click" Style="float: left" ImageUrl="~/Img/calendar.gif"
                        CommandArgument='<%#Eval("Codigo")%>' />
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#3A4F63" Font-Bold="True" ForeColor="White" Font-Size="14px" />
            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
            <RowStyle HorizontalAlign="Center" VerticalAlign="Middle" BackColor="#F7F6F3" 
                ForeColor="#333333" />
            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
        </asp:GridView>

    </center>
    <asp:LinqDataSource ID="DBCursos" runat="server" 
        ContextTypeName="FastDATA.DCCursoDataContext" EntityTypeName="" 
        OrderBy="Codigo" Select="new (DETipoCurso, DECursoHorario, DECursoAlunos, DataInicio, DataFim, Codigo, Status)" TableName="DECursos">
    </asp:LinqDataSource>
</asp:Content>